
<volist name="list" id="list">
    <div class="porder-item">
        <h3 class="porder-item-state">
            <if condition="$list.order_status eq 0">等待买家付款</if>
            <if condition="$list.order_status eq 1">买家已付款</if>
            <if condition="$list.order_status eq 2">卖家已发货</if>
            <if condition="$list.order_status eq 3">交易已完成</if>
            <if condition="$list.order_status eq -1">订单已取消</if>
        </h3>

        <volist name="$list.order_goods" id="goods">
            <div class="porder-item-info clearfix">
                <div class="pic fl">
                    <a href="{:U('Goods/goods_detail',array('item_id' => $goods.goods_id))}"><img src="{$goods.original_img}"></a>
                </div>
                <div class="word fr">
                    <h3 class="t"><a href="{:U('Goods/goods_detail',array('item_id' => $goods.goods_id))}">{$goods.goods_name}</a><span class="price">￥{$goods.goods_price}</span></h3>
                    <div class="f clearfix">
                        <span class="guig fl">{$goods.spec_key_name}</span> <span class="num fr">X{$goods.goods_num}</span>
                    </div>
                </div>
            </div>
        </volist>
        <div class="porder-item-all">
            共{:count($list.order_goods)}件商品 合计：<span class="jiag">￥{$list.goods_price}</span>(运费：商家赠送）
        </div>
        <div class="porder-item-opera clearfix">
            <a href="tel:{$config.index_phone}" class="o-btn">联系客服</a>
            <a href="{:U('Order/shop_detail',array('item_id' => $list.order_id))}" class="o-btn">查看详情</a>
            <if condition="$list.order_status eq 0">
                <a href="{:U('Order/shop_detail',array('item_id' => $list.order_id))}" class="o-btn">付款</a>
            </if>
            <if condition="$list.order_status eq 2"><a href="javascript:;" class="o-btn" onclick="confirm_receipt_1({$list.order_id})">确认收货</a></if>
            <if condition="$list.order_status eq 3"><a href="javascript:;" class="o-btn" onclick="del_shop_order({$list.order_id})" >删除订单</a></if>
        </div>
    </div>
</volist>


<script>
    //确认收货
    function confirm_receipt_1(item_id){
        $.ajax({
            type : "POST",
            url:"/Home/Order/confirm_receipt.html",
            data : {item_id:item_id},// 你的formid 搜索表单 序列化提交
            dataType:'json',
            success: function(result){
                if (result.status == 200){
                    layer.msg(result.msg,{icon:1,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                }else{
                    layer.msg(result.msg,{icon:2,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                }
            }
        });
    }

    //删除订单
    function del_shop_order(item_id){
        $.ajax({
            type : "POST",
            url:"/Home/Order/del_shop_order.html",
            data : {item_id:item_id},// 你的formid 搜索表单 序列化提交
            dataType:'json',
            success: function(result){
                if (result.status == 200){
                    layer.msg(result.msg,{icon:1,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                }else{
                    layer.msg(result.msg,{icon:2,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                }
            }
        });
    }

</script>